import request from '@/utils/request'
import { praseStrEmpty } from "@/utils/ruoyi";

// 查询产品与图案列表
export function listProduct(query) {
  return request({
    url: '/business/product/list',
    method: 'get',
    params: query
  })
}

// 查询产品与图案详细信息
export function getProduct(productId) {
  return request({
    url: '/business/product/' + praseStrEmpty(productId),
    method: 'get'
  })
}

// 新增产品与图案
export function addProduct(data) {
  return request({
    url: '/business/product',
    method: 'post',
    data: data
  })
}

// 修改产品与图案
export function updateProduct(data) {
  return request({
    url: '/business/product',
    method: 'put',
    data: data
  })
}

// 删除产品与图案
export function delProduct(productId) {
  return request({
    url: '/business/product/' + productId,
    method: 'delete'
  })
}

// 下载产品与图案导入模板
export function importTemplate() {
  return request({
    url: '/business/product/importTemplate',
    method: 'get'
  })
}

// 导出产品与图案
export function exportProduct(query) {
  return request({
    url: '/business/product/export',
    method: 'get',
    params: query
  })
}
